//
//  YYJLRankCell.m
//  YuanyangJinlou
//
//  Created by mac004 on 2017/1/4.
//  Copyright © 2017年 suli19910309@qq.com. All rights reserved.
//

#import "YYJLRankCell.h"
@interface YYJLRankCell (){
    UILabel * rankLb;//排名
    UIImageView * headerView;//头像
    UILabel * name ;//姓名
    UIImageView * level;
    UILabel * detail;//详细信息
    UILabel * rank;//分数
}
@end
@implementation YYJLRankCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self =[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
    }return self;
}

-(void)creatUI{
    rankLb=[MyControl createLabelWithFrame:CGRectMake(20*PER_WIDTH, 25*PER_HEIGHT, 21*PER_WIDTH, 21*PER_WIDTH) Font:21 Text:@"4" Color:FEELT_COLOR];
    rankLb.font=[UIFont fontWithName:HLT size:21*PER_WIDTH];
    [self.contentView addSubview:rankLb];
    
    headerView=[[UIImageView alloc]initWithFrame:CGRectMake(50*PER_WIDTH, 15*PER_HEIGHT, 40*PER_WIDTH, 40*PER_WIDTH)];
    headerView.image=[UIImage imageNamed:@"touxiang2-80x80"];
    [self.contentView addSubview:headerView];
    
    name=[MyControl createLabelWithFrame:CGRectMake(headerView.right+10*PER_WIDTH, 18*PER_HEIGHT, 100*PER_WIDTH, 15*PER_HEIGHT) Font:15 Text:@"邹奥" Color:BLACK_COLOR];
    [self.contentView addSubview:name];
    
    UIImage * levelImg=[UIImage imageNamed:@"1"];
    level=[[UIImageView alloc]initWithFrame:CGRectMake(headerView.right+10*PER_WIDTH, name.bottom+10*PER_HEIGHT, levelImg.size.width*PER_WIDTH, levelImg.size.height*PER_HEIGHT)];
    level.image=levelImg;
    [self.contentView addSubview:level];
    
    detail=[MyControl createLabelWithFrame:CGRectMake(level.right+10*PER_WIDTH, name.bottom+10*PER_HEIGHT, 200, 12*PER_HEIGHT) Font:12 Text:@"店长-深圳车公庙沃达" Color:FEELT_COLOR];
    [self.contentView addSubview:detail];
    
    
    rank=[MyControl createLabelWithFrame:CGRectMake(100, 28*PER_HEIGHT, 100, 21) Font:21 Text:@"178" Color:TINK_COLOR];
    CGFloat width =[rank.text boundingRectWithSize:CGSizeMake(1000, 21) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName :rank.font} context:nil].size.width;
    rank.frame=CGRectMake(SCREEN_WIDTH-20*PER_WIDTH-width, 28*PER_HEIGHT, width, 21*PER_HEIGHT);
    [self.contentView addSubview:rank];
    
    UIImage*markImg=[UIImage imageNamed:@"ico_zuan"];
    UIImageView * markView=[[UIImageView alloc]initWithFrame:CGRectMake(rank.left-6*PER_WIDTH-markImg.size.width*PER_WIDTH, 26*PER_HEIGHT, markImg.size.width*PER_WIDTH, markImg.size.height*PER_HEIGHT)];
    markView.image=markImg;
    [self.contentView addSubview:markView];
    UIView * line =[[UIView alloc]initWithFrame:CGRectMake(0, 138*PER_HEIGHT, self.width, 1)];
    line.backgroundColor=UIColorFromHex(0xcccccc);
    [self.contentView addSubview:line];
}
@end
